package com.ai.wxy.spring.auth.dto;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * User DTO
 *
 * @author 石头
 * @Date 2019/10/30
 * @Version 1.0
 **/
@Data
public class UserDTO {
    private Long id;
    @NotBlank(groups = Login.class)
    @Pattern(regexp = "^[a-zA-Z][a-z0-9A-Z_]{4,8}[a-z0-9A-Z]$",message = "格式错误【用户名称为字母开头和结尾且长度为6~10】",groups={Login.class})
    private String username;
    @NotBlank
    @Pattern(regexp = "^[a-zA-Z][a-z0-9A-Z_#@!]{4,8}[a-z0-9A-Z]$",message = "格式错误【用户密码为字母开头和结尾且长度为6~10】",groups={Login.class})
    private String password;
    private boolean enabled;
    private boolean accountNonLocked;
    private Date lastPasswordResetDate;
    /**登录持有的令牌(前端需要)*/
    private String token;
    public @interface Login {}
}
